//Copyright (C) 2012 Chirila Alexandru
//This file is part of Mirror FTP
//
//Mirror FTP is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//Mirror FTP is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with Mirror FTP.  If not, see <http://www.gnu.org/licenses/>.

#ifndef FILE_STRUCT_H_
#define FILE_STRUCT_H_

#include <gtkmm.h>

#include <fstream>
using namespace std;


/**
 * Extension of the class Gtk::TreeView,
 * shows current directory list of elements
 */
class file_struct : public Gtk::TreeView{	//file structure view
public:
	Glib::RefPtr<Gtk::ListStore> ref;
	Gtk::TreeModelColumn<Glib::ustring> name;
	Gtk::TreeModelColumn<Glib::ustring> type;
	Gtk::TreeModelColumn<Glib::ustring> rights;
	Gtk::TreeModelColumn<Glib::ustring> owner;
	Gtk::TreeModelColumn<Glib::ustring> date;
	Gtk::TreeModelColumn<Glib::ustring> mirror;
	Gtk::TreeModelColumn<long long> size;
	Gtk::TreeModelColumnRecord record;
public:
	file_struct();
	virtual ~file_struct();
	void new_row(Glib::ustring t,Glib::ustring n,long long s,Glib::ustring r,Glib::ustring o,Glib::ustring d,Glib::ustring m);
	void fill_list(Glib::ustring tmp_file,Glib::ustring parrent);
	void clear();
};

#endif /* FILE_STRUCT_H_ */
